package com.zxq.web.notifyplatfrom;

import com.zxq.exchange.enums.EFrame;
import com.zxq.exchange.register.INotifyPlatform;
import com.zxq.web.notifyplatfrom.impl.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class NotifyPlatformFactory {


    @Autowired
    SFRegisterNotifyPlatform sfRegisterNotifyPlatform;

    @Autowired
    ModbusNotifyPlatform modbusNotifyPlatform;

    @Autowired
    DLT645NotifyPlatform dlt645NotifyPlatform;

    @Autowired
    JT808NotifyPlatform jt808NotifyPlatform;

    @Autowired
    FYChargePilePlatform fyChargePilePlatform;

    /**
     * 提醒平台消息
     * @param eFrame 平台消息
     * @return 返回值
     */
    public INotifyPlatform create(EFrame eFrame) {
        INotifyPlatform iNotifyPlatform = null;
        switch (eFrame) {
            case sf_register:
                iNotifyPlatform = sfRegisterNotifyPlatform;
                break;
            case modbus:
                iNotifyPlatform = modbusNotifyPlatform;
                break;
            case dlt645:
                iNotifyPlatform = dlt645NotifyPlatform;
                break;
            case jt808:
                iNotifyPlatform = jt808NotifyPlatform;
                break;
            case fy_charge_pile:
                iNotifyPlatform = fyChargePilePlatform;
                break;
        }
        return iNotifyPlatform;
    }



}
